<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:profile="http://www.contact.core.profile.com/contacts/core/profile/ui"
      xmlns:common="http://www.contact.common.com/contacts/ui"
      xmlns:a4j="http://richfaces.org/a4j"
        >

<ui:component>
    <style type="text/css">
        .richBody {
            padding: 0px;
            background: #F7F7F7;
            text-align: center;
        }
    </style>
    <h:form id="informationTab">
        <h:panelGroup style="width:600px;" rendered="#{profileSessionBean.editingInformation}" id="editInformation"
                      layout="block">
            <h:panelGrid id="informationTab" columns="1">
                <h:panelGroup layout="block"
                              style="background-color:#ffff99; height:51px; width:600px;  border:double 1px ">
                    <h:panelGroup layout="block" style=" float:left;margin:10px; vertical-align:middle;">
                        <h:outputLabel value="#{resources.doneAndSavingInformationText}"/>
                    </h:panelGroup>
                    <h:panelGroup layout="block"
                                  style="float:right; margin-top:10px;width:80px;text-align:right; vertical-align:middle;">
                        <a4j:commandButton value="#{resources.doneLabel}"
                                           action="#{profile.action}"
                                           reRender="informationTab"/>
                    </h:panelGroup>

                </h:panelGroup>

            </h:panelGrid>
        </h:panelGroup>

        <h:panelGroup style="width:600px;" rendered="#{not profileSessionBean.editingInformation}" id="viewInformation"
                      layout="block">
            <h:panelGrid id="editInformationTabble" columns="1">
                <h:panelGroup layout="block">
                    <h:panelGroup layout="block" style="float:left; width:380px"/>
                    <h:panelGroup rendered="#{profile.myProfilePage}" layout="block"
                                  style="float:right; text-align:right; width:120px">
                        <a4j:commandButton value="#{resources.editInformationLabel}"
                                           reRender="informationTab"
                                           action="#{profile.prepareForEditInformation}"/>

                    </h:panelGroup>
                </h:panelGroup>
                <h:panelGroup id="basicInformationPanelGroup">
                    <h:panelGroup rendered="#{not profileSessionBean.editBasicInformation}" layout="block">
                        <profile:basicInformation reRender="basicInformationPanelGroup"/>
                    </h:panelGroup>
                    <h:panelGroup rendered="#{profileSessionBean.editBasicInformation and profile.myProfilePage}"
                                  layout="block">
                        <common:richPanel header="#{resources.basicInformationLabel}"
                                          reRender="basicInformationPanelGroup"
                                          bean="#{profile}" id="basicInformationEditPanel"
                                          value="basicInformation">
                            <ui:define name="panelBody">
                                <profile:editBaseInformation reRender="basicInformationPanelGroup"/>
                            </ui:define>
                        </common:richPanel>

                    </h:panelGroup>
                </h:panelGroup>

                <h:panelGroup id="contactInformationPanelGroup">
                    <h:panelGroup rendered="#{not profileSessionBean.editContactInformation }" layout="block">
                        <profile:contactInformation reRender="contactInformationPanelGroup"/>
                    </h:panelGroup>
                    <h:panelGroup rendered="#{profileSessionBean.editContactInformation and  profile.myProfilePage}"
                                  layout="block">
                        <common:richPanel header="#{resources.contactInformationLabel}"
                                          reRender="contactInformationPanelGroup"
                                          bean="#{profile}" id="contactInformationEditPanel"
                                          value="contactInformation">
                            <ui:define name="panelBody">
                                <profile:editContactInformation id="allEdit" reRender="contactInformationPanelGroup"/>
                            </ui:define>
                        </common:richPanel>

                    </h:panelGroup>
                </h:panelGroup>

                <h:panelGroup id="personalInformationPanelGroup"
                              rendered="#{personalInformation.existsPersonalInformation}">
                    <h:panelGroup rendered="#{not profileSessionBean.editPersonalInformation}" layout="block">
                        <profile:personalInformation reRender="personalInformationPanelGroup"/>
                    </h:panelGroup>
                    <h:panelGroup rendered="#{profileSessionBean.editPersonalInformation and  profile.myProfilePage}"
                                  layout="block">
                        <common:richPanel header="#{resources.personalInformationLabel}"
                                          reRender="personalInformationPanelGroup"
                                          bean="#{profile}" id="personalInformationEditPanel"
                                          value="personalInformation">
                            <ui:define name="panelBody">
                                <!--<h:outputLabel value="Ovde ce se nalaziti editor za Personal Information"/>-->
                                <profile:editPersonalInformation reRender="personalInformationPanelGroup"/>
                            </ui:define>
                        </common:richPanel>

                    </h:panelGroup>
                </h:panelGroup>

                <h:panelGroup id="eduworkInformationPanelGroup"
                              rendered="#{eduWorkInformation.existsEduWorkInformation}">
                    <h:panelGroup rendered="#{not profileSessionBean.editEduWorkInformation}" layout="block">
                        <profile:eduAndWorkInformation reRender="eduworkInformationPanelGroup"/>
                    </h:panelGroup>
                    <h:panelGroup rendered="#{profileSessionBean.editContactInformation and  profile.myProfilePage}"
                                  layout="block">
                        <common:richPanel header="#{resources.eduWorkInformationLabel}"
                                          reRender="eduworkInformationPanelGroup"
                                          bean="#{profile}" id="eduWorkInformationEditPanel"
                                          value="eduWorkInformation">
                            <ui:define name="panelBody">
                                <profile:editEduWorkInformation id="allEdit" reRender="eduworkInformationPanelGroup"/>
                            </ui:define>
                        </common:richPanel>

                    </h:panelGroup>
                </h:panelGroup>
            </h:panelGrid>


        </h:panelGroup>

        <h:panelGroup style="width:600px;" id="editAllInformation"
                      rendered="#{profileSessionBean.editingInformation and  profile.myProfilePage}"
                      layout="block">
            <rich:simpleTogglePanel label="#{resources.basicInformationLabel}"
                                    reRender="editAllInformation"
                                    switchType="client"
                                    limitToList="true"
                                    width="600px"
                                    opened="false"
                                    bodyClass="richBody"
                    >


                <profile:editBaseInformation/>
            </rich:simpleTogglePanel>
            <rich:simpleTogglePanel label="#{resources.contactInformationLabel}"
                                    switchType="client"
                                    limitToList="true"
                                    width="600px"
                                    opened="false"
                                    bodyClass="richBody"
                    >


                <profile:editContactInformation id="simpleEdit"/>
            </rich:simpleTogglePanel>
            <rich:simpleTogglePanel label="#{resources.personalInformationLabel}"
                                    reRender="editAllInformation"
                                    switchType="client"
                                    limitToList="true"
                                    width="600px"
                                    opened="false"
                                    bodyClass="richBody"
                    >


                <profile:editPersonalInformation/>
            </rich:simpleTogglePanel>
            <rich:simpleTogglePanel label="#{resources.eduWorkInformationLabel}"
                                    switchType="client"
                                    limitToList="true"
                                    width="600px"
                                    opened="false"
                                    bodyClass="richBody"
                    >


                <profile:editEduWorkInformation id="simpleEdit"/>
            </rich:simpleTogglePanel>
            <!--<rich:panelBarItem-->
            <!--label="Contact Information">-->
            <!--<h:outputLabel value="Contact Information"/>-->
            <!--</rich:panelBarItem>-->
            <!--<rich:panelBarItem-->
            <!--label="Personal Information">-->
            <!--<h:outputLabel value="Personal Information"/>-->
            <!--</rich:panelBarItem>-->
            <!--<rich:panelBarItem-->
            <!--label="Edu And Work Information ">-->
            <!--<h:outputLabel value="Edu And Work Information"/>-->
            <!--</rich:panelBarItem>-->


        </h:panelGroup>


    </h:form>


</ui:component>


</html>
